package com.xizi.final_;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

/**
 * @author xizizzz
 * @description: TODO
 * @date 2021-7-30下午 04:40
 */
public final class test {
    public final static String str = "123";

    public static void main(String[] args) throws InterruptedException {
        try {
            System.out.println(new test().getClass().getClassLoader());
            System.out.println(ClassLoader.getSystemClassLoader());
            System.out.println(ClassLoader.getSystemClassLoader().getParent());
            System.out.println(ClassLoader.getSystemClassLoader().getParent().getParent());
            Object o = new Object();
//        o.wait();
            //fnal只能约束map这个引用不可以被赋值，但是strList对象行为不被fnal影响，添加元素等操作是完全正常的。
            final HashMap<Object, Object> map = new HashMap<>();
            map.put(1, 1);
            map.put(1, 1);
            map.put(1, 1);
            Map<Object, Object> map1 = Collections.synchronizedMap(map);
            HashMap<Object, Object> map2 = map;
//            map=new HashMap<>();
            System.gc();
            System.runFinalization();
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
        }

    }
}
